﻿@model IEnumerable<Tradukisto.Model.LocalItem>
<table class="resultTable">
    <tr>
        <th class="resultsHeader">
            @Html.DisplayNameFor(model => model.ControllerName)
        </th>
        <th class="resultsHeader">
            @Html.DisplayNameFor(model => model.ActionName)
        </th>
        <th class="resultsHeader">
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th class="resultsHeader">
            @Html.DisplayNameFor(model => model.Culture)
        </th>
        <th class="resultsHeader">
            @Html.DisplayNameFor(model => model.Value)
        </th>
        <th class="resultsHeaderCommand">Commands</th>
    </tr>
    @if (Model.Count() != 0)
    {
        foreach (var item in Model)
        {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.ControllerName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ActionName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Culture)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Value)
            </td>
            <td>
                <i class="icon-edit"></i>@Ajax.ActionLink("Edit", "Edit", new { id = item.Id }, new AjaxOptions
                                    {
                                        HttpMethod = "GET",
                                        InsertionMode = InsertionMode.Replace,
                                        UpdateTargetId = "editItem",
                                        OnSuccess = "showEditForm"
                                    }, new { @class = "commandLink" }) |
            <i class="icon-random"></i>@Ajax.ActionLink("Translate", "Translate", new { id = item.Id }, new AjaxOptions
                                  {
                                      HttpMethod = "GET",
                                      InsertionMode = InsertionMode.Replace,
                                      UpdateTargetId = "editItem",
                                      OnSuccess = "showTranslateForm"
                                  }, new { @class = "commandLink" }) |
            <i class="icon-trash"></i>@Ajax.ActionLink("Delete", "DeteleteItem", new { id = item.Id }, new AjaxOptions
                                 {
                                     HttpMethod = "POST",
                                     OnSuccess = "successDelete",
                                     Confirm = "Delete this item?"
                                 }, new { @class = "commandLink" })
            </td>
        </tr>
        }
    }
    else
    { 
        <tr>
            <td colspan="5" class="noRecords">No records found</td>
        </tr>
    }

</table>
